﻿using FreeSql.DatabaseModel;using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Newtonsoft.Json;
using FreeSql.DataAnnotations;

namespace xxl_job {

	[JsonObject(MemberSerialization.OptIn), Table(Name = "xxl_job_info", DisableSyncStructure = true)]
	public partial class XxlJobInfo {

		[JsonProperty, Column(Name = "id", IsPrimary = true, IsIdentity = true)]
		public int Id { get; set; }

		[JsonProperty, Column(Name = "add_time", DbType = "datetime")]
		public DateTime? AddTime { get; set; }

		/// <summary>
		/// 报警邮件
		/// </summary>
		[JsonProperty, Column(Name = "alarm_email")]
		public string AlarmEmail { get; set; }

		/// <summary>
		/// 作者
		/// </summary>
		[JsonProperty, Column(Name = "author", StringLength = 64)]
		public string Author { get; set; }

		/// <summary>
		/// 子任务ID，多个逗号分隔
		/// </summary>
		[JsonProperty, Column(Name = "child_jobid")]
		public string ChildJobid { get; set; }

		/// <summary>
		/// 阻塞处理策略
		/// </summary>
		[JsonProperty, Column(Name = "executor_block_strategy", StringLength = 50)]
		public string ExecutorBlockStrategy { get; set; }

		/// <summary>
		/// 失败重试次数
		/// </summary>
		[JsonProperty, Column(Name = "executor_fail_retry_count")]
		public int ExecutorFailRetryCount { get; set; } = 0;

		/// <summary>
		/// 执行器任务handler
		/// </summary>
		[JsonProperty, Column(Name = "executor_handler")]
		public string ExecutorHandler { get; set; }

		/// <summary>
		/// 执行器任务参数
		/// </summary>
		[JsonProperty, Column(Name = "executor_param", StringLength = 512)]
		public string ExecutorParam { get; set; }

		/// <summary>
		/// 执行器路由策略
		/// </summary>
		[JsonProperty, Column(Name = "executor_route_strategy", StringLength = 50)]
		public string ExecutorRouteStrategy { get; set; }

		/// <summary>
		/// 任务执行超时时间，单位秒
		/// </summary>
		[JsonProperty, Column(Name = "executor_timeout")]
		public int ExecutorTimeout { get; set; } = 0;

		/// <summary>
		/// GLUE备注
		/// </summary>
		[JsonProperty, Column(Name = "glue_remark", StringLength = 128)]
		public string GlueRemark { get; set; }

		/// <summary>
		/// GLUE源代码
		/// </summary>
		[JsonProperty, Column(Name = "glue_source", DbType = "mediumtext")]
		public string GlueSource { get; set; }

		/// <summary>
		/// GLUE类型
		/// </summary>
		[JsonProperty, Column(Name = "glue_type", StringLength = 50, IsNullable = false)]
		public string GlueType { get; set; }

		/// <summary>
		/// GLUE更新时间
		/// </summary>
		[JsonProperty, Column(Name = "glue_updatetime", DbType = "datetime")]
		public DateTime? GlueUpdatetime { get; set; }

		/// <summary>
		/// 任务执行CRON
		/// </summary>
		[JsonProperty, Column(Name = "job_cron", StringLength = 128, IsNullable = false)]
		public string JobCron { get; set; }

		[JsonProperty, Column(Name = "job_desc", IsNullable = false)]
		public string JobDesc { get; set; }

		/// <summary>
		/// 执行器主键ID
		/// </summary>
		[JsonProperty, Column(Name = "job_group")]
		public int JobGroup { get; set; }

		/// <summary>
		/// 上次调度时间
		/// </summary>
		[JsonProperty, Column(Name = "trigger_last_time", DbType = "bigint(13)")]
		public long TriggerLastTime { get; set; } = 0;

		/// <summary>
		/// 下次调度时间
		/// </summary>
		[JsonProperty, Column(Name = "trigger_next_time", DbType = "bigint(13)")]
		public long TriggerNextTime { get; set; } = 0;

		/// <summary>
		/// 调度状态：0-停止，1-运行
		/// </summary>
		[JsonProperty, Column(Name = "trigger_status", DbType = "tinyint(4)")]
		public sbyte TriggerStatus { get; set; } = 0;

		[JsonProperty, Column(Name = "update_time", DbType = "datetime")]
		public DateTime? UpdateTime { get; set; }

	}

}
